package com.example.hcbmsm.controller;

import com.example.hcbmsm.domain.PreDrug;
import com.example.hcbmsm.service.PreDrugService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author Xinghm
 * @version 1.0
 * @since 2024/11/1 16:31
 */
@RestController
@CrossOrigin
@RequestMapping("/preDrug")
public class PreDrugController {
    @Autowired
    private PreDrugService preDrugService;
    @PostMapping("/add")
    public Map add(String token, @RequestBody PreDrug preDrug) {
        return preDrugService.add(token, preDrug);
    }
    @GetMapping("/listByPreId")
    public Map listByPreId(Long preId) {
        return preDrugService.listByPreId(preId);
    }
}
